package cn.source.system.service.impl;

import cn.source.common.utils.DateUtils;
import cn.source.system.domain.NavSiteConfig;
import cn.source.system.mapper.NavSiteConfigMapper;
import cn.source.system.service.INavSiteConfigService;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @program: source-vue
 * @ClassName: NavSiteConfigServiceImpl
 * @description: 网站配置Service业务层处理
 * @author: 诗涵
 * @create: 2024-02-20 14:33
 */
@Service
@AllArgsConstructor
public class NavSiteConfigServiceImpl implements INavSiteConfigService {
    private final NavSiteConfigMapper navSiteConfigMapper;

    /**
     * 查询网站配置列表
     *
     * @param navSiteConfig 网站配置
     * @return 网站配置
     */
    @Override
    public List<NavSiteConfig> selectNavSiteConfigList(NavSiteConfig navSiteConfig)
    {
        return navSiteConfigMapper.selectNavSiteConfigList(navSiteConfig);
    }

    /**
     * 新增网站配置
     *
     * @param navSiteConfig 网站配置
     * @return 结果
     */
    @Override
    public int insertNavSiteConfig(NavSiteConfig navSiteConfig)
    {
        navSiteConfig.setCreateTime(DateUtils.getNowDate());
        return navSiteConfigMapper.insertNavSiteConfig(navSiteConfig);
    }

    /**
     * 修改网站配置
     *
     * @param navSiteConfig 网站配置
     * @return 结果
     */
    @Override
    public int updateNavSiteConfig(NavSiteConfig navSiteConfig)
    {
        navSiteConfig.setUpdateTime(DateUtils.getNowDate());
        return navSiteConfigMapper.updateNavSiteConfig(navSiteConfig);
    }
}
